package pl.kosmowska.ewelina.client.app.activity.mappers;

import pl.kosmowska.ewelina.client.app.ClientFactory;
import pl.kosmowska.ewelina.client.app.activity.SignInActivity;
import pl.kosmowska.ewelina.client.app.activity.places.SignInPlace;

import com.google.gwt.activity.shared.Activity;
import com.google.gwt.activity.shared.ActivityMapper;
import com.google.gwt.place.shared.Place;

public class ApplicationActivityMapper implements ActivityMapper {
  
  private ClientFactory clientFactory;

  public ApplicationActivityMapper(ClientFactory clientFactory) {
    super();
    this.clientFactory = clientFactory;
  }
  

  @Override
  public Activity getActivity(Place place) {

    if (place instanceof SignInPlace) {
      return new SignInActivity((SignInPlace) place, clientFactory);
      
    }
      return null;

  }

}
